var winston = require('winston');//logger

winston.loggers.add('app', {
    console: {
        timestamp : true,
        level: 'silly',
        colorize: true
    },
    DailyRotateFile: {
        datePattern : '-yyyy-MM-dd.log',
        level: 'silly',
        maxFiles : 15,
        filename: 'logs/blog4node'
    }
});

winston.loggers.add('access', {
    console: {
        timestamp : true,
        level: 'ERROR',
        colorize: true
    },
    DailyRotateFile: {
        datePattern : '-yyyy-MM-dd.log',
        level: 'silly',
        maxFiles : 15,
        filename: 'logs/access'
    }
});

winston.addColors({
    log : 'blank',
    trace : 'magenta',
    debug : 'blue',
    info : 'blue',
    warn : 'yellow',
    error : 'red'
});

;
module.exports = {
    global : winston.loggers.get('app'),
    access : winston.loggers.get('access')
}